import { IAlertParams, PanelItemController } from '@ibiz-template/runtime';
import { IPanelRawItem } from '@ibiz/model-core';
import { createUUID } from 'qx-util';
import { CoopPosState } from './coop-pos.state';

export class CoopPosController extends PanelItemController<IPanelRawItem> {
  declare state: CoopPosState;

  protected createState(): CoopPosState {
    return new CoopPosState(this.parent?.state);
  }

  /**
   * 更新消息
   *
   * @author zhanghengfeng
   * @date 2024-04-03 17:04:25
   * @param {IAlertParams} params
   */
  updateMessage(params: IAlertParams): void {
    this.state.key = createUUID();
    this.state.alertParams = params;
  }
}
